Skip to content

Fix DeepSpeed 0.17 compatibility (bf16 config + nested autocast)#1063

Merged
pascal-pfeiffer merged 1 commit into
mainfrom
fix/deepspeed-0.17-compat
Jun 3, 2026
Merged

Fix DeepSpeed 0.17 compatibility (bf16 config + nested autocast)#1063
pascal-pfeiffer merged 1 commit into
mainfrom
fix/deepspeed-0.17-compat

Conversation

@pascal-pfeiffer

Copy link
Copy Markdown
Collaborator

DeepSpeed 0.17.x validates configs with pydantic (extra='forbid') and asserts against torch.autocast nested outside the engine.

  • Remove invalid loss_scale_window from the bf16 ds_config block; it is only valid for fp16 (DeepSpeedBF16Config rejects it). Older DeepSpeed silently ignored it.
  • Disable the forward-pass torch.autocast wrapper when using DeepSpeed, since the engine handles mixed precision via its bf16/fp16 config. Matches the existing gating in the backward pass and eval loop.

closes #945

DeepSpeed 0.17.x validates configs with pydantic (extra='forbid') and
asserts against torch.autocast nested outside the engine.

- Remove invalid `loss_scale_window` from the bf16 ds_config block; it is
  only valid for fp16 (DeepSpeedBF16Config rejects it). Older DeepSpeed
  silently ignored it.
- Disable the forward-pass torch.autocast wrapper when using DeepSpeed,
  since the engine handles mixed precision via its bf16/fp16 config.
  Matches the existing gating in the backward pass and eval loop.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@pascal-pfeiffer pascal-pfeiffer merged commit 674f8c3 into main Jun 3, 2026
6 of 11 checks passed
@pascal-pfeiffer pascal-pfeiffer deleted the fix/deepspeed-0.17-compat branch June 3, 2026 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Deepspeed / transformers mismatch

1 participant